﻿using Cosmos.DataAccess.Trade.HighGate.Internals.Protocol;
using Cosmos.DataAccess.Trade.v1;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cosmos.DataAccess.Trade.HighGate.v1
{
    public sealed class TradeDataSubscription : ITradeDataSubscription
    {
        public TradeDataSubscription(IEnumerable<DataPushJob> dataPushJobs)
        {
            _dataPushJobs = dataPushJobs.ToArray();
        }
        public async Task UnsubscribeAsync()
        {
            foreach (var job in _dataPushJobs)
            {
                job.Stop();
            }
        }
        public IReadOnlyCollection<DataPushJob> _dataPushJobs { get; }

        public string Topic { get; set; }   
    }

}
